Skip to content

refactor(deps): declare dependency features in member crates - #688

Merged
wan9chi merged 1 commit into
mainfrom
agent/deps-features-per-crate
Aug 18, 2026
Merged

refactor(deps): declare dependency features in member crates#688
wan9chi merged 1 commit into
mainfrom
agent/deps-features-per-crate

Conversation

@wan9chi

@wan9chi wan9chi commented Aug 18, 2026

Copy link
Copy Markdown
Member

Motivation

Features declared on [workspace.dependencies] entries are forced on every member that uses the dependency — a member can add features but never subtract them — so the workspace manifest quietly over-featured most crates and hid which crate actually needs what. Every features = [...] list moves from the workspace manifest to the member crates that use it; default-features = false stays at the workspace level, where it is the only place it can take effect.

Moving them exposed two kinds of rot:

  • Dead features: bumpalo/collections was declared workspace-wide for one brace-grouped import in fspy's arena (now declared there); nix/dir was used only by vt's fingerprinting; nix/signal only by pty_terminal's tests; xxhash-rust/const_xxh3 had no users at all and is gone.
  • Masked under-declarations: fspy_ipc_str uses TransparentWrapperAlloc (extern_crate_alloc) but only compiled because the workspace forced the feature; it now declares it.

Every affected member was checked individually (cargo check -p … --all-targets) on the host plus the Linux and Windows targets, so no member relies on feature unification from a sibling.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  +0.13%  [-12.11% .. +14.72%]  overhead  +285.49%
dynamic/access             change  -0.37%  [-15.47% ..  +1.93%]  overhead    +7.76%
dynamic/access-relative    change  +0.45%  [-13.26% ..  +4.44%]  overhead   +48.08%
dynamic/access-contended   change  +1.68%  [ -3.85% .. +15.64%]  overhead   +10.99%
static/launch              change  +1.17%  [ -9.69% .. +12.30%]  overhead  +637.41%
static/access              change  -0.02%  [ -8.00% ..  +9.40%]  overhead  +829.07%
static/access-relative     change  +1.62%  [ -6.23% ..  +8.42%]  overhead +1171.13%
static/access-contended    change  -2.30%  [-13.51% ..  +6.40%]  overhead +1993.69%

macos

dynamic/launch             change  -0.96%  [ -4.29% ..  +3.85%]  overhead  +215.70%
dynamic/access             change  +0.36%  [ -2.51% ..  +3.77%]  overhead    +4.84%
dynamic/access-relative    change  +0.00%  [ -2.28% ..  +2.70%]  overhead  +259.03%
dynamic/access-contended   change  +0.28%  [ -7.71% ..  +6.09%]  overhead    +4.19%

windows

dynamic/launch             change  +0.08%  [ -5.52% ..  +4.80%]  overhead   +25.74%
dynamic/access             change  -0.19%  [ -1.26% ..  +1.29%]  overhead    +1.33%
dynamic/access-relative    change  +0.36%  [ -0.91% ..  +1.27%]  overhead    +1.83%
dynamic/access-contended   change  -0.45%  [ -2.56% ..  +1.91%]  overhead    +2.12%

Features on [workspace.dependencies] entries are forced on every
member that uses the dependency — members can add features but never
subtract — so the workspace manifest over-featured most crates and hid
which crate needs what. Every features list moves to the member crates
that use it; default-features = false stays at the workspace level,
the only place it takes effect.

Moving them exposed rot in both directions: bumpalo/collections was
workspace-wide for one import in fspy's arena, nix/dir was used only
by vt's fingerprinting, nix/signal only by pty_terminal's tests, and
xxhash-rust/const_xxh3 had no users at all and is gone; fspy_ipc_str
used extern_crate_alloc without declaring it and only compiled because
the workspace forced the feature.

Every affected member was checked individually with
cargo check -p --all-targets on the host plus the Linux and Windows
targets, so no member relies on feature unification from a sibling.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@wan9chi
wan9chi force-pushed the agent/deps-features-per-crate branch from 3cab90f to 82c867d Compare August 18, 2026 17:20
@wan9chi
wan9chi marked this pull request as ready for review August 18, 2026 17:21
@wan9chi
wan9chi merged commit 47d79f2 into main Aug 18, 2026
19 checks passed
@wan9chi
wan9chi deleted the agent/deps-features-per-crate branch August 18, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant